/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ucm;

import controller.Traffic;
import javax.swing.JButton;

/**
 * Use case control components class to handle start simulation button event.
 * @author Chiaki Sato
 * @since J2SDK 1.6
 * @version 1.0
 */
public class UCStartSimulationButton extends JButton implements UCController{

    private Traffic oTraffic;

    /**
     * Constructor of start simulation button class that initializes instance variables based on input parameters.
     * @param stText Control caption text
     * @param oTraffic Traffic object
     */
    public UCStartSimulationButton(String stText, Traffic oTraffic) {

        super(stText);
        this.oTraffic = oTraffic;
    }

    /**
     * Public run function to execute a process of user clicking event on the start simulation button.
     */
    public void run() {

        // User clicks the start simulation button
        // System starts the intersection traffic simulation process
        oTraffic.StartTrafficThread();

    }
}
